Repository navigation
[FEATURE] add dither, impulsive noise detection, regularized inversion and near/far-field merging - #113
Open
aguirreSL wants to merge 1 commit into
Open
[FEATURE] add dither, impulsive noise detection, regularized inversion and near/far-field merging#113aguirreSL wants to merge 1 commit into
aguirreSL wants to merge 1 commit into
Conversation
…_far Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds to
pytta.functionsfour tools for measurements that the ITA-Toolbox has in its measurement application (ita_dither,ita_impulsiveNoiseDetection,ita_invert_spk_minphase_regularizationandita_add_nearfield_farfield_measurements):dither(signal, bits=24, kind='tri', quiet=False, seed=None): dither noise added before quantization tobitsbits, rectangular, triangular or Gaussian (Lipshitz, Wannamaker and Vanderkooy, "Quantization and dither: a theoretical survey", J. Audio Eng. Soc. 40(5), 1992). Withquiet, silent samples stay silent.impulsive_noise(ir, excitation, noise_start, threshold=20): the part of a measured impulse response afternoise_start, convolved again with the excitation, rebuilds the background noise of the recording; L_max_rms = 20 lg(max / rms) of that noise above 20 dB flags an impulsive event. It returns the flag, the level and the noise.invert_spectrum(signal, freqRange, minimum_phase=False): the regularized inverse conj(H) / (|H|² + ε) (Kirkeby, Rubak, Nelson and Farina, 1999), with ε negligible insidefreqRangeand half the largest |H|² outside it, crossfaded over half an octave, the rule thatImpulsiveResponseuses for its regularization. Withminimum_phasethe inverse gets the minimum phase of its magnitude.merge_near_far(near, far, crossover, order=4, port=None, port_ratio=1): a loudspeaker response from a near-field measurement below the crossover and a far-field one above it (Keele, "Low-frequency loudspeaker assessment by nearfield sound-pressure measurement", J. Audio Eng. Soc. 22(3), 1974). The near-field response, with a port response added for a vented box, is aligned in time and level with the far-field one and crossfaded with power-complementary Butterworth weights that add up to 1.These ITA functions belong to an application of the ITA-Toolbox whose license is "all rights reserved", so only their help text was read and the functions are written from the references.
The tests in
tests/test_measurement_tools.pyprint the measured values:Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of
development(3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com